﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Areas/CustomerAdmin/Customer.Master" CodeBehind="Departments.aspx.cs" Inherits="OnlineBusinesses.Areas.CustomerAdmin.Departments" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="ContentCustomerAdmin">
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 10px;">
        <h3 style="font-weight: bold;">Quản lý phòng ban </h3>
        <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 10px 0px;">
            <h4 class="text-danger">
                <asp:Label ID="lbNotice" runat="server"></asp:Label>
            </h4>
            <div class="col-md-4 col-lg-4 col-xs-12 col-sm-12" style="padding:5px;">
                <asp:TextBox ID="txtDepartmentName" runat="server" type="text" class="input_add" placeholder="Tên phòng ban" />
            </div>
            <div class="col-md-6 col-lg-6 col-xs-12 col-sm-12" style="padding:5px;">
                <asp:TextBox ID="txtDescription" runat="server" type="text" class="input_add" placeholder="Diễn giải" />
            </div>
            <div class="col-md-2 col-lg-2 col-xs-12 col-sm-12" style="padding:5px;">
                <asp:LinkButton ID="btnCreate"  OnClientClick="ShowProgress();" runat="server" OnCommand="btnCreate_Click" class="btn btn-default" Style="width: 100%; border-radius: 0px; background:#337BEA;color:#fff;">Tạo phòng ban</asp:LinkButton>
                <asp:LinkButton ID="btnEditSuccess" OnClientClick="ShowProgress();" runat="server" OnCommand="btnEditSuccess_Click" class="btn btn-success" Style="width: 100%; border-radius: 0px;background:#337BEA;color:#fff;">Lưu thay đổi</asp:LinkButton>
            </div>
        </div>
    </div>
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="margin: 10px 0px; padding: 0px; height: 1px; background: #ddd;"></div>
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 10px; padding-bottom: 50px;">
        <div class="table-responsive">
            <asp:ListView
                ID="lvDepartments"
                runat="server">
                <LayoutTemplate>
                    <table class="table table-bordered table-striped" id="dataTables-example">
                        <thead>
                            <tr>
                                <th style="width: 50px; text-align: center;">STT</th>
                                <th>Tên phòng ban</th>
                                <th>Diễn giải</th>
                                <th>Trưởng phòng ban</th>
                                <th style="width: 110px; text-align: center;">Số người</th>
                                <th style="width: 230px; padding-left: 10px;">Tùy chỉnh</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr id="ItemPlaceholder" runat="server">
                            </tr>
                        </tbody>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td style="vertical-align: middle; text-align: center;"><%# Container.DisplayIndex + 1  %></td>
                        <td style="vertical-align: middle; font-weight: bold;"><%# Eval("DepartmentName") %></td>
                        <td style="vertical-align: middle; overflow: hidden;"><%# Eval("Description") %></td>
                        <td style="vertical-align: middle;"><%# Eval("MainDepartmentName") %></td>
                        <td style="vertical-align: middle; text-align: center;"><%# Eval("NumberOfAccounts")  %></td>
                        <td style="vertical-align: middle; text-align: right;">
                            <a href="ViewGroups.aspx?id=<%# Eval("DepartmentID")  %>" onclick="ShowProgress();" style="color: #333; text-decoration: none;">
                                <span class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Xem" style="border-radius: 0px; margin-right: 10px;">
                                    <span class="fa fa-eye"></span>
                                </span>
                            </a>
                            <asp:LinkButton runat="server" OnClientClick="ShowProgress();" CommandArgument='<%#Eval("DepartmentID") %>' ID="btnEdit" OnCommand="btnEdit_Click" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Chỉnh sửa" style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-wrench"></span></asp:LinkButton>
                            <asp:LinkButton runat="server" OnClientClick="return confirm('Bạn có chắc là muốn xoá không?');" ID="btnDel" OnCommand="btnDel_Click" CommandArgument='<%#Eval("DepartmentID") %>' class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Xóa" style="border-radius: 0px; margin-right: 10px;">
                                <span class="fa fa-times"></span></asp:LinkButton>
                            <a href="Rules.aspx?did=<%# Eval("DepartmentID")  %>" onclick="ShowProgress();" style="color: #fff; text-decoration: none;">
                                <span class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Phân quyền" style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-check-square-o"></span></span>
                            </a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </div>
    </div>
</asp:Content>
